Skip to content

List and unique list#8

Open
Palezehvat wants to merge 9 commits intomasterfrom
ListAndUniqueList
Open

List and unique list#8
Palezehvat wants to merge 9 commits intomasterfrom
ListAndUniqueList

Conversation

@Palezehvat
Copy link
Owner

4 дз

@@ -0,0 +1,3 @@
namespace ListAndUniqueList;

public class InvalidItemException : Exception {} No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо комментарии и к исключениям тоже

@@ -0,0 +1,123 @@
namespace ListAndUniqueList;

// Container for storing values

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Надо комментарии в правильном формате :)

Comment on lines 6 to 7
public ListElement? Head;
public ListElement? Tail;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public-поля нельзя вообще

{
if (Head == null)
{
ListElement item = new ListElement(value, 0);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ListElement item = new ListElement(value, 0);
var item = new ListElement(value, 0);


class Program
{
public static void Main(string[] args)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это не нужно

Comment on lines 47 to 50
public override bool IsEmpty()
{
return base.IsEmpty();
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем их тогда перегружать?


public class Tests
{
List list;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List list;
private List list;

Comment on lines +15 to +16
[TestCaseSource(nameof(ListForTest))]
public void ListShouldBeEmptyWhenCreated(List list)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем тогда поле list? :) Уберите TestCaseSource, либо добавьте уникальный список туда, чтобы эти тесты сразу два проверяли.

list.AddElement(10);
int item = 0;
list.RemoveElement(ref item);
Assert.True(item == 10);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is.EqualTo

}

[TestCaseSource(nameof(ListForTest))]
public void UniqueListShouldBeEmptyWhenCreated(UniqueList uniqueList)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ну, копипаст. Оставьте тут только тесты, которые должны работать для UniqueList, но не должны для List, а остальное тестируйте тестами выше

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments